#ifndef MAPITEMFACTORY_H
#define MAPITEMFACTORY_H

#pragma warning( disable : 4290 )

#include "itemfactory.h"
class MapItem;

class mapitemfactory_error : public std::logic_error 
{
public:
	mapitemfactory_error(const std::string &error) : logic_error(error) { }
};

class MapItemFactory : public ItemFactory{
public:
	MapItemFactory();
	~MapItemFactory();
	
	void setWalkable(bool);
	void setItem(bool item);
	void setPortal(bool portal);
	bool getWalkable();

	void create(std::string id) throw (mapitemfactory_error);
	MapItem* build(std::string id) throw(mapitemfactory_error);
	void save();
	void load(std::string id) throw(mapitemfactory_error);
	void delItem() throw(mapitemfactory_error);

protected:
	MapItem* mapitem_;

private:
	void makeConn();

};

#endif
